#include "my_stdio.h"
#include <string.h>
#include <unistd.h>

#define PATH "test.txt"

int main()
{
    _FILE* fp = _fopen(PATH, "a");
    if (fp == NULL)
        return 1;

    const char* msg = "hello world\n";
    for (int i = 0; i < 10; ++i)
    {
        _fwrite(fp, msg, strlen(msg));
        sleep(1);
    }

    _fclose(fp);
    return 0;
}
